use "C:\Users\nicholasdavis\Downloads\16 anes.dta" 
regress sorting religiosity evangelical secular mainline jewish catholic interest abortion govspend sophistication male white black age educ7cat oldsouth _88  _92  _94  _96  _00  _08  _12 [pweight= vcf0010z] if pid3==3, robust
tab regress sorting religiosity01 whiteevangelical secular mainline jewish catholic interest abortion govspend sophistication male white black age educ7cat oldsouth _88  _92  _94  _96  _00  _08  _12 [pweight= vcf0010z] if pid3==3, robust
tab V161265x
gen secular = .
replace secular = 1 if V161266j==1
replace secular = 1 if V161266k==1
replace secular = 1 if V161266m==1
replace secular = 0 if secular==.
gen mainline = .
replace mainline = 1 if V161266a==1
replace mainline = 1 if V161266b==1
replace mainline = 1 if V161266c==1
replace mainline = 1 if V161266d==1
replace mainline = 1 if V161266e==1
replace mainline = 1 if V161266f==1
replace mainline = 1 if V161266g==1
replace mainline = 1 if V161266h==1
gen whiteevangelical = 1 if white==1 & mainline==1 & V161263==1
tab whiteevangelical
replace whiteevangelical=0 if whiteevangelical==.
replace mainline = 0 if mainline==1 & whiteevangelical==1
tab mainline
replace mainline=0 if mainline==.
sum mainline secular whiteevangelical
reg sorting religiosity mainline secular whiteevangelical knowledge govspend abortion educ white black male
tab V161267
gen age = V161267
recode age -9/0=.
reg sorting religiosity mainline secular whiteevangelical knowledge govspend abortion educ white black male age interest [pweight= V160102], robust if pid3==0
reg sorting religiosity mainline secular whiteevangelical knowledge govspend abortion educ white black male age interest [pweight= V160102]if pid3==0, robust
reg sorting religiosity mainline secular whiteevangelical knowledge govspend abortion educ white black male age interest [pweight= V160102]if pid3==2, robust
gen pidxrelig = pid3*religiosity
reg sorting religiosity pid3 pidxreligiosity mainline secular whiteevangelical knowledge govspend abortion educ white black male age interest [pweight= V160102], robust
reg sorting religiosity pid3 pidxrelig mainline secular whiteevangelical knowledge govspend abortion educ white black male age interest [pweight= V160102], robust
tab abortion
tab govspend
tab V161178
recode govspend 99=.
reg sorting religiosity pid3 pidxrelig mainline secular whiteevangelical knowledge govspend abortion educ white black male age interest [pweight= V160102], robust
tab V161178
tab V161010d
gen fips = V161010d
replace oldsouth=1 if fips== 1 | fips==5 | fips==12 | fips==13 | fips==18 | fips==21 | fips==22 | fips==28 | fips==37 | fips==45 | fips==47 | fips==51 | fips==54
replace oldsouth=0 if oldsouth==.
gen oldsouth= .
replace oldsouth=1 if fips== 1 | fips==5 | fips==12 | fips==13 | fips==18 | fips==21 | fips==22 | fips==28 | fips==37 | fips==45 | fips==47 | fips==51 | fips==54
replace oldsouth=0 if oldsouth==.

***final analysis
reg sorting religiosity pid3 pidxrelig mainline secular whiteevangelical knowledge govspend abortion educ white black male age interest oldsouth [pweight= V160102], robust
